package net.tribal.escpos.barcode

import net.tribal.escpos.util.PrinterUtils

public class UpcEBarCode implements BarCode{
	
	void printBarCode(code, out){
		def n = code.size()
		if (n >= 11 && n <=12){
			out << PrinterUtils.getHexValue(29)
			out << PrinterUtils.getHexValue(107)
			out << PrinterUtils.getHexValue(66)
			out << PrinterUtils.getHexValue(n)
			out << code
			out << PrinterUtils.getHexValue(0)
		}
	}
}